package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;

import com.example.myapplication.UI.UIActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    private Button btn_UI,btn_FourComponents,btn_dataStorage,btn_palaceTreasury,btn_fragment,btn_project;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //沉浸式状态栏
        if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.KITKAT) {
            //透明状态栏
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            //透明导航栏
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }

        //绑定控件
        initview();


    }

    private void initview() {
        btn_UI = findViewById(R.id.btn_UI);
        btn_FourComponents = findViewById(R.id.btn_FourComponents);
        btn_dataStorage = findViewById(R.id.btn_dataStorage);
        btn_palaceTreasury = findViewById(R.id.btn_palaceTreasury);
        btn_fragment = findViewById(R.id.btn_fragment);
        btn_project = findViewById(R.id.btn_project);

        btn_UI.setOnClickListener(this);
        btn_FourComponents.setOnClickListener(this);
        btn_dataStorage.setOnClickListener(this);
        btn_palaceTreasury.setOnClickListener(this);
        btn_fragment.setOnClickListener(this);
        btn_project.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_UI:
                Intent intent = new Intent(MainActivity.this, UIActivity.class);
                startActivity(intent);
                break;
        }
    }
}